﻿<?php session_start(); if(!isset($_SESSION[ "logeado"])){ header( "Location:Login.php"); } ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Ubicaci&oacute;n de la unidad</title>
    
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
	    
    <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3.13&key=AIzaSyAjtCN4bd3XMgrR9qwM5ji4wfqfZhnfbgE&sensor=true"></script>
    <script src="js/jquery.js"></script>
        <script src="js/canvasjs.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function () {
				HideControls();
				$('#btnGenerar').prop('disabled', true);
		});
	</script>
	<script type="text/javascript">
	 var p = "<?php echo $_SESSION['token'] ?>";
	 var idRolUsuarioSesion = "<?php  echo $_SESSION['rol'] ?>";
	 var idLineaSesion = "<?php  echo $_SESSION['id_linea'] ?>";
    </script>
      <script src="js/functions.js"></script>
</head>

<body>
    <div id="container">
        <div id="container2">
            <!--Aqui empieza el contenido uno-->
            <div id="contenido">
                <center>
                    <p>
                        <a name="inicio" id="inicio"></a>
                    </p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p style="margin-left:53%">
                    <label>Bienvenido: </label>
                    <label><strong><?php  echo $_SESSION['nombre']; ?> </strong></label>
                    <label>- Rol: </label>
					<label><strong><?php  echo $_SESSION['rol']; ?> </strong>|</label>
                    <a href="Logout.php">Salir</a></p>
                    <h2 style="margin-left:5%">Reportes de unidades en Tiempo Real</h2>
                    <center>

                        <table width="65%" border="0" style="margin-left:5%">
                            <tr>
                                <td colspan="2">&nbsp;</td>
                                <td colspan="2" align="center">
                                    <label>Elije un reporte:</label>
                                    <select id="reportes" onchange="consultaLineas()">
                                        <option value="0">Seleccione Reporte</option>
                                        <option value="1">Ubicación Exacta</option>
                                        <option value="2">Altos Totales</option>
                                        <option value="3">Checkpoints</option>
                                        <option value="4">Comportamiento de Conducción</option>
                                        <option value="5">KM Recorridos</option>

                                    </select>
                                </td>
                                <td width="16%">&nbsp;</td>	
                            </tr>
                            <tr>
                                <td colspan="5">&nbsp;</td>
                            </tr>
                            <tr align="center">
                                <td colspan="2">
                                    <label id="lblineas">L&iacute;neas:</label>
                                    <br/>
                                    <input type="button" id="btnselectall1" onClick="SeleccionaTodo(1)" value="Seleccionar todo" class="newStyleBtn" />
                                </td>
                                <td colspan="2">
                                    <label id="lbroles">Roles:</label>
                                    <br/>
                                    <input type="button" id="btnselectall2" onClick="SeleccionaTodo(2)" value="Seleccionar todo" class="newStyleBtn" />
                                </td>
                                <td>
                                    <label id="lbunidades">Unidades :</label>
                                    <br/>
                                    <input type="button" id="btnselectall3" onClick="SeleccionaTodo(3)" value="Seleccionar todo" class="newStyleBtn" />
                                </td>
                            </tr>
                            <tr align="center">
                                <td width="30%" valign="top">
                                    <select id="lineas" multiple="multiple" style=" width:80%" size="8" onfocus="habilitaBoton1()">
                                    </select>
                                </td>
                                <td width="5%" valign="middle">
                                    <input id="btngo1" onclick="consultaRoles()" type="image" src="images/go.png" />
                                </td>
                                <td width="30%">
                                    <select id="roles" multiple="multiple" style=" width:80% " size="8" onfocus="habilitaBoton2()">
                                    </select>
                                </td>
                                <td width="5%" valign="middle">
                                    <input id="btngo2" onclick="ConsultaUnidades()" type="image" src="images/go.png" />
                                </td>
                                <td width="30%">
                                    <select id="unidades" multiple="multiple" style=" width:80% " size="8" onfocus="habilitaBotonGenerar()">
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">&nbsp;</td>
                                <td colspan="2" align="center">&nbsp;</td>
                                <td>&nbsp;</td>
                            </tr>
                            <tr>
                                <td colspan="2">&nbsp;</td>
                                <td colspan="2" align="center">
                                    <button type="submit" id="btnGenerar" onclick="btnGenerar()" class="newStyleBtn" />Generar</button>&nbsp;
                                    <button type="submit" id="btnLimpiar" onclick="btnLimpiar()" class="newStyleBtn" />Limpiar</button>
                                </td>
                                <td>&nbsp;</td>
                            </tr>
                        </table>
                    </center>
                </center>
                <br />
                <div id="mapa" style="width:65%; height:50%; margin-left:20%">
                    <div id="map-canvas" visible="false" style="display: none"> </div>
					<div id="chartContainer" name="grafica" style="height: 500px; width: 50%;" align="center" style="display: none">
					</div>
                </div>
				
            </div>
            <!--Aqui termina el contenido uno -->
            <!--Aqui empieza el contenido dos-->
            <div id="contenido-medio">
                <!--INI contenido-medio-->
                <!--FIN contenido-medio-->
            </div>
            <!--Aqui termina el contenido dos -->
            <div id="footer" align="center">
                <div id="text_footer"><strong>ACTIA M&eacute;xico,</strong> 2013 © Copyright Todos los derechos reservados</div>
            </div>
        </div>
    </div>
</body>

</html>